import Vue from 'vue'
import Router from 'vue-router'
import Nav from '@/admin/nav'
import login from '@/admin/login'
import loginfail from '@/admin/loginfail'
import binding from '@/admin/binding'
import redirect from '@/admin/redirect'
import system from '@/admin/system/system'
import list from '@/admin/system/list'
import menu from '@/admin/system/menu'
import role from '@/admin/system/role'
import viewRight from '@/admin/system/viewRight'
import modifyRight from '@/admin/system/modifyRight'
// import config from '@/admin/system/config'
// import newsList from '@/admin/forum/newsList'
// import newsDetail from '@/admin/forum/newsDetail'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/redirect',
      component: redirect
    },
    {
      path: '/admin',
      name: '首页',
      component: login,
      children: [
        {
          path: '/login',
          component: login
        },
        {
          path: '/loginfail/:type',
          component: loginfail
        },
        {
          path: '/binding/:type',
          component: binding
        },
        {
          path: '/index',
          name: '首页',
          component: Nav,
          children: [
            {
              path: 'system',
              name: '系统设置',
              redirect: '/admin/index/system/list/:id',
              component: system,
              children: [
                {
                  path: 'list/:id',
                  name: '团队管理员列表',
                  component: list
                },
                {
                  path: 'menu/:id',
                  name: '菜单管理',
                  component: menu
                },
                {
                  path: 'role/:id',
                  name: '角色管理',
                  component: role
                },
                {
                  path: 'viewRight/:mid',
                  name: '查看详情',
                  component: viewRight
                },
                {
                  path: 'modifyRight/:rid',
                  name: '设置权限',
                  component: modifyRight
                }
              ]
            }
          ]
        }
      ]
    }
  ]
})
